Generic Programming within Dependently Typed Programming
نویسندگان
چکیده
We show how higher kinded generic programming can be represented faithfully within a dependently typed programming system. This development has been implemented using the Oleg system. The present work can be seen as evidence for our thesis that extensions of type systems can be done by programming within a dependently typed language, using data as codes for types.
منابع مشابه
Generic Description of Well-Scoped, Well-Typed Syntaxes
We adapt the technique of type-generic programming via descriptions pointing into a universe to the domain of typed languages with binders and variables, implementing a notion of syntax-generic programming in a dependently typed programming language. We present an Agda library implementation of type-preserving renaming and substitution (including proofs about their behaviour) “once and for all”...
متن کاملSequential decision problems, dependently-typed solutions
We propose a dependently typed formalization for a simple class of sequential decision problems. For this class of problems, we implement a generic version of Bellman’s backwards induction algorithm [2] and a machine checkable proof that the proposed implementation is correct. The formalization is generic. It is presented in Idris, but it can be easily translated to other dependently-typed prog...
متن کاملSupporting Dependently Typed Functional Programming with Testing and User-Assisted Proof Automation
Developing dependently typed functional programs can be difficult because the user may be required to write proofs and program errors are often hard to identify and fix. We describe a framework, implemented in Coq, that combines testing with user-assisted proof automation to make development easier. Testing occurs within Coq and is used to give user feedback to program errors and faulty conject...
متن کاملGeneric Programming with Dependent Types
Some programs are doubly generic. For example, map is datatype-generic in that many different data structures support a mapping operation. A generic programming language like Generic Haskell can use a single definition to generate map for each type. However, map is also arity-generic because it belongs to a family of related operations that differ in the number of arguments. For lists, this fam...
متن کاملGeneric Programming for Dependent Types Constructing Strictly Positive Families
We begin by revisiting the idea of using a universe of types to write generic programs in a dependently typed setting by constructing a universe for Strictly Positive Types (SPTs). Here we extend this construction to cover dependent types, i.e. Strictly Positive Families (SPFs), thereby fixing a gap left open in previous work. Using the approach presented here we are able to represent all of Ep...
متن کامل